PowerTCP Mail for .NET
Read(Byte[],ArrayList,Int32,Int32,Boolean) Method
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > SegmentedStream Class > Read Method : Read(Byte[],ArrayList,Int32,Int32,Boolean) Method




buffer
The storage location for the received data.
delimiters
The list of tokens to search for.
offset
The zero-based position in the buffer at which to store the received data.
count
The maximum number of bytes to read.
found
True if delimiteris found; false otherwise.
Read data from the stream until one of the specified delimiters is found.

Syntax

Visual Basic (Declaration) 
Public Overloads Function Read( _
   ByVal buffer() As Byte, _
   ByVal delimiters As ArrayList, _
   ByVal offset As Integer, _
   ByVal count As Integer, _
   ByRef found As Boolean _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As SegmentedStream
Dim buffer() As Byte
Dim delimiters As ArrayList
Dim offset As Integer
Dim count As Integer
Dim found As Boolean
Dim value As Integer
 
value = instance.Read(buffer, delimiters, offset, count, found)
C# 
public int Read( 
   byte[] buffer,
   ArrayList delimiters,
   int offset,
   int count,
   ref bool found
)
Managed Extensions for C++ 
public: int Read( 
   byte[]* buffer,
   ArrayList* delimiters,
   int offset,
   int count,
   ref bool found
) 
C++/CLI 
public:
int Read( 
   array<byte>^ buffer,
   ArrayList^ delimiters,
   int offset,
   int count,
   bool% found
) 

Parameters

buffer
The storage location for the received data.
delimiters
The list of tokens to search for.
offset
The zero-based position in the buffer at which to store the received data.
count
The maximum number of bytes to read.
found
True if delimiteris found; false otherwise.

Return Value

The total number of bytes read into the buffer, which will normally be less than count. Returns 0 if end of stream is reached and there is no data left to return.

Exceptions

ExceptionDescription
System.IO.IOExceptionThrown when the stream is not readable.
System.ArgumentNullExceptionThrown when the receiving buffer is null.
System.ArgumentOutOfRangeExceptionThrown when the offset is less than zero or when count is less than or equal to zero.
System.ArgumentExceptionThrown when (offset + count) > buffer.Length.
System.IO.EndOfStreamException At least one byte was read without finding a delimiter before end of stream was reached.

Remarks

This method reads from the stream and returns when one of the provided delimiters is found, count bytes have been read, or end of stream is reached.

The purpose of this method is to provide a convenient way to read a variable-length record from the stream. The delimiters list must consist of byte arrays.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.